package com.wocao.controller.uniapp;

import com.wocao.entity.ZyOwnerRoom;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;


@CrossOrigin
@Controller
@RequestMapping("uni-app")
public class HouseBindingController {
    //获取业主类型
    @GetMapping("OwnerTypes")
    public String getOwnerTypes() {
        return "/sysDictData-find?dictType=zy_owner_state";
    }


    //获取全部小区
    @GetMapping("/houseBinding/communities")
    public String getCommunities() {
        return "/zyCommunity/communities";
    }

    //根据小区id获取全部楼栋
    @GetMapping("/buildings/{communityId}")
    public String getBuildingsByComId(@PathVariable String communityId) {
        return "/zyBuilding/buildings/" + communityId;
    }

    //根据楼栋id获取全部单元
    @GetMapping("/units/{buildingId}")
    public String getUnitsByBuildingId(@PathVariable String buildingId) {
        return "/zyUnit/units/" + buildingId;
    }


    //根据单元id获取全部房间
    @GetMapping("/rooms/{unitId}")
    public String getRoomsByUnitId(@PathVariable String unitId) {
        return "/zyRoom/rooms/" + unitId;
    }

}
